home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
050
/
madtrb4.arc
/
LESSRAM.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1984-12-20
|
3KB
|
69 lines
{@@@@@@@@@@@ copyright (C) 1984 by Neil J. Rubenking @@@@@@@@@@@@@@@@@@@@@@@@
The purchaser of these procedures and functions may include them in COMPILED
programs freely, but may not sell or give away the source text.
This little program is to be used for TESTING other programs.
Suppose you have 640K (and why not?!), but users of the
program you're developing may only have 64K. To be SURE they
can use it, you could open your PC and set your switches down
to 64K. LESSRAM makes this switch-setting unnecessary. It
changes what's recorded in the location where your PC stores
what it thinks your memory is, and then "warm reboots" to make
the new value active.
1) You MUST run this program COMPILED to disk.
2) Just type LESSRAM nnn, where nnn is a number LESS than
your actual RAM. (If you leave off the parameter, you
will get a message as to just how much RAM you have, and
a chance to set the new value.
3) LESSRAM should be used immediately after booting up (either
by turning PC on or by <Ctrl><Alt><Del>). If another
program has been active, LESSRAM may hang up your system
4) It appears that certain device drivers in the CONFIG.SYS
file interfere with LESSRAM. If I run LESSRAM on my system,
I have to rename CONFIG.SYS to something else first --
otherwise my A: drive spins indefinitely.
5) Strangely enough, using LESSRAM does NOT clear out resident
programs like SIDEKICK, even though they reside in high
memory.
}
{$I reboot.lib}
type
ParamString = string[3];
var
Memory_Size : integer absolute $0040:$0013;
Parameter : ParamString absolute CSeg:$0081;
ParamLength : byte absolute CSeg:$0080;
AsciiNew : ParamString;
New_Size : integer;
{@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
procedure GetParameters;
var
code : integer;
begin
AsciiNew := copy(Parameter,1,ParamLength);
val(AsciiNEW,New_Size,code);
if code <> 0 then
New_Size := 0;
end;
{@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}
begin
GetParameters;
if New_Size = 0 then
begin
WriteLn('Your switches show ',Memory_size,'K.');
repeat
WriteLn('Enter size to reset memory to: ');
read(New_Size);
until (New_Size > 64) and (New_Size <= Memory_size);
end;
Memory_Size := New_Size;
WriteLn;
WriteLn('Memory Size word changed to ',Memory_Size);
WRiteLn('Press a key to go on to REBOOT the system.');
repeat until keypressed;
reboot;
end.